<?php
namespace app\pet\controller;
use think\Db;
Class Platform extends Common{

    public function index(){
        $res = obj_decode( $this->read(1) );
        if($res['code']){
            $res = $res['data'];
            $poster1 = Db::connect('db_log')->name('upload_log')->where(['url'=>$res['poster1']])->find();
            $res['poster1']  =  [$poster1];
        }
        else{
            $res = [

            ];
        }
        $this->assign('data',$res);
        return $this->fetch();
    }

    public function txtSub(){
        $params = $this->params;
        unset($params['file']);
        $params['id'] = 1;
        $res = $this->update($params);
        if(obj_decode($res)['code']){
            return_msg(1,'修改成功！',[],'#');
        }
    }

}